package com.wesley.blockchain;

import com.alibaba.fastjson.JSONObject;
import com.wesley.blockchain.model.Block;
import com.wesley.blockchain.model.Transaction;

import java.util.ArrayList;
import java.util.List;

/**
 * App
 * @author WangPanYong
 * @since 2021/06/23 14:01
 */
public class App {

    public static void main(String[] args) {
        List<Block> blockchain = new ArrayList<Block>();

        Block block = new Block();
        block.setIndex(1)
             .setNonce(1)
             .setTimestamp(System.currentTimeMillis())
             .setHash("123")
             .setPreviousHash("000")
             .setTransactions(new ArrayList<Transaction>());

        blockchain.add(block);
        String res = JSONObject.toJSONString(blockchain);
        System.out.println(res);
    }
}
